#!/bin/ash
set -eu
set -o pipefail

# An awk program to add timestamp prefix to all logged lines.
AWK_LOG_PREFIX='{ print strftime("%Y-%m-%d %H:%M:%S:"), $0; fflush(); }'

su roundcube -s /bin/sh -c '/usr/share/webapps/roundcube/bin/cleandb.php' 2>&1 \
	| awk "$AWK_LOG_PREFIX" \
	| tee -a /var/log/roundcube/cron.log
